#!usr/bin/env python  
# -*- coding:utf-8 _*-
""" 
@author:robot
@file: node02_aggregation.py 
@version:
@time: 2022/05/18 
"""
# 07
from TapClientCore.T04_logic.Dag02.node.operate_node.node08_field_rename import FieldRenameNode


class Aggregation(FieldRenameNode):

    def generate_node(self, op):
        if not op:
            raise Exception('NO AGG config')
        node = {
            "id": self.newId,
            "name": "自动化-聚合",
            "type": "aggregation_processor",
            "attrs": {
                "position": [
                    -500,
                    200
                ]
            },
            'aggregations': op
        }
        self.node = node
